fix(test_ros2cli_daemon): add RMW isolation fixture for zenoh router#1216
Merged
ahcorde merged 1 commit intoros2:rollingfrom Mar 27, 2026
Merged
fix(test_ros2cli_daemon): add RMW isolation fixture for zenoh router#1216ahcorde merged 1 commit intoros2:rollingfrom
ahcorde merged 1 commit intoros2:rollingfrom
Conversation
test_ros2cli_daemon.py spawns a daemon subprocess with no explicit env=, so the daemon inherits os.environ. When running with rmw_zenoh_cpp, the daemon and the test node cannot discover each other without a router. Add an autouse session fixture that calls rmw_test_isolation_start() when available; this starts an in-process router and sets ZENOH_CONFIG_OVERRIDE so the daemon inherits the connection endpoint. Signed-off-by: yuanyuyuan <az6980522@gmail.com>
1388f81 to
24d6090
Compare
ahcorde
approved these changes
Mar 26, 2026
Contributor
|
Pulls: #1216 |
fujitatomoya
approved these changes
Mar 27, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
test_ros2cli_daemonfails in theRci__nightly-zenoh_ubuntu_noble_amd64CI because the ROS 2 CLI daemon and the test node cannot discover each other — no isolated network is set up for the test, so cross-process node discovery fails.Key Changes
autousesession-scoped fixturermw_isolationthat callsrmw_test_isolation_start()/rmw_test_isolation_stop()around the entire test session, beforespawn_daemon()is calledtry/except ImportErrorso the fixture is a no-op on non-Zenoh RMW implementations where the package is absentrmw_test_fixture_implementationas a test dependency inpackage.xmlBreaking Changes
None
Deep Dive
rmw_test_isolation_start()starts an in-process Zenoh router on a random port and setsZENOH_CONFIG_OVERRIDE=connect/endpoints=[tcp/127.0.0.1:<port>]in the current process environment (line 136–139). Any subprocess that inheritsos.environwill have rmw_zenoh_cpp connect to that router and share the same discovery graph.spawn_daemon()callssubprocess.Popen()with no explicitenv=, so the daemon naturally inheritsos.environ. Starting isolation beforespawn_daemon()is therefore sufficient — the daemon picks up the router endpoint from the environment and connects to the same network as the test node.Closes ros2/rmw_zenoh#932